/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.struts;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author eswar
 */
public class ClgBean extends org.apache.struts.action.ActionForm {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private String fname;
    private String mname;
    private String gender;
    private String address;

    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public String getMname() {
        return mname;
    }

    public void setMname(String mname) {
        this.mname = mname;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
   private String error_name;
   private String error_fname;
   private String error_mname;

    public String getError_name() {
        return error_name;
    }

    public void setError_name(String error_name) {
        this.error_name = error_name;
    }

    public String getError_fname() {
        return error_fname;
    }

    public void setError_fname(String error_fname) {
        this.error_fname = error_fname;
    }

    public String getError_mname() {
        return error_mname;
    }

    public void setError_mname(String error_mname) {
        this.error_mname = error_mname;
    }

    public String getError_gender() {
        return error_gender;
    }

    public void setError_gender(String error_gender) {
        this.error_gender = error_gender;
    }

    public String getError_address() {
        return error_address;
    }

    public void setError_address(String error_address) {
        this.error_address = error_address;
    }
   private String error_gender;
   private String error_address;

    /**
     *
     */
    public ClgBean() {
        super();
        // TODO Auto-generated constructor stub
    }

  
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getName() == null || getName().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }
}
